# -*- coding: ISO-8859-1 -*-
"""\
A basic web server for testing the BibConverter CGI interface.

Based on http://groups.google.com/group/comp.lang.python/msg/3e76d94e4d3e9d74
"""

import sys

try:
    import bibconverter
except:
    print "Warning: Could not load the bibconverter module."
    print "Make sure that the bibcconverter module is in your python path."

 
from BaseHTTPServer import HTTPServer
from CGIHTTPServer import CGIHTTPRequestHandler


PORT = 8000

serveradress = ("",PORT)
print "Serving at port ", PORT
print "Point your favourite browser to http://localhost:%i/" % PORT
print "Press CTRL-BREAK to stop the server."
server = HTTPServer(serveradress, CGIHTTPRequestHandler)
server.serve_forever() 